package com.zhiyou.service.impl;

import com.zhiyou.bean.Code;
import com.zhiyou.dao.CodeMapper;
import com.zhiyou.service.CodeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CodeServiceImpl implements CodeService {

    @Resource
    CodeMapper codeMapper;

    @Override
    public int addVerifyCode(String verifyCode, String tel) {
        Code code = new Code();
        code.setCodes(verifyCode);
        code.setPhone(tel);
        return codeMapper.insertSelective(code);
    }

    @Override
    public Code getCode(Code code) {
        return codeMapper.selectOne(code);
    }
}
